package com.crl.animation
{
	import com.crl.animation.pak.AniDef;
	import com.crl.animation.pak.PakDef;
	import com.crl.animation.pak.RenderDef;
	import com.crl.animation.resource.PakResource;
	
	import flash.display.Graphics;

	public class PakRender extends AbstractRender
	{
		public var data:PakDef;
		private var delay:int;
		
		
		protected var _g:Graphics;
		protected var _action:int;
		protected var _direction:int;
		
		protected var pakResources:Vector.<PakResource>;
		protected var currentRenders:Vector.<RenderDef>;
		protected var renderDef:RenderDef;
		
		public function PakRender()
		{
			super();
		}
		
		public function set action(key:int):void{
			_action=key;
			//currentActionRenders=data.actions[key].renders;
		}
		
		public function set direction(key:int):void{
			_direction=key;
			
		}
		
		override public function render(now:int):void{
			
			if(renderedTime+delay>now){
				return ;
			}
			
			//renderDef.render(_g,this);
			
			delay=renderDef.t;
			
			renderDef=currentRenders[renderDef.n];
			
		}
	}
}